package cn.anc.aonicardv.util;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;


import cn.anc.aonicardv.R;

public class ToastUtils {

    public static void toast(Context context,int iconRes, String msg) {
        Toast t = new Toast(context);
        View v = LayoutInflater.from(context).inflate(R.layout.layout_app_toast, null);
        TextView iconTv = v.findViewById(R.id.tv_toast_icon);
        TextView wordTv = v.findViewById(R.id.tv_toast_word);
        t.setView(v);
        t.setGravity(Gravity.CENTER, 0, 0);
        iconTv.setBackgroundResource(iconRes);
        wordTv.setText(msg);
        t.show();
    }

}
